﻿#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int arr[] = { 1,2,3,4,5,6,7,8,9 };
	int i = 0;
	int sz = sizeof(arr) / sizeof(arr[0]);
	int left = 0, right = sz - 1;
	scanf("%d", &i);
	int flag = 0;
	while (left <= right)
	{
		int mid = left + (right - left) / 2;
		if (arr[mid] < i)
		{
			left = mid + 1;
		}
		else if (arr[mid] > i)
		{
			right = mid - 1;
		}
		else
		{
			printf("找到了，下标是%d", mid);
			flag = 1;
			break;
		}
	}
	if (flag == 0)
	{
		printf("没找到");
	}

	return 0;
}